import qs from "qs"
import url from '@/url.config'

export default ({ service, request, tools}) => ({

    getMonitorList (data) {
        return request({
            url: url.ip3+"/monitor/findByPage",
            method: "post",
            data:data
        })
    },
    getMonitorLists (data) {
        return request({
            url: url.ip3+"/monitor/findByPage",
            method: "post",
            data:data
        })
    },

    addMonitorList(data) {
        return request({
            url: url.ip3+"/monitor/save",
            method: "post",
            data:data
        })
    },
    editMonitorList(data) {
        return request({
            url: url.ip3+"/monitor/edit",
            method: "post",
            data:data
        })
    },
    removeMonitorList(id) {
        return request({
            url: url.ip3+"/monitor/remove/"+id,
            method: "post"
        })
    },
    getCompanyInfo(id) {
        return request({
            url: url.ip2+"/company/findByCompanyId/"+id,
            method: "post"
        })
    },
    getAcquisitionList (id) {
        return request({
            url: url.ip3+"/acquisition/findByMonitorId/"+id,
            method: "post"
        })
    },
    getdictionaryList(name){
      return request({
          url:url.ip2+`/dictionary/list?name=${name}`,
          method:"post"
      })
    },
    addAcquisitionList(data) {
        return request({
            url: url.ip3+"/acquisition/save",
            method: "post",
            data:data
        })
    },
    editAcquisitionList(data) {
        return request({
            url: url.ip3+"/acquisition/edit",
            method: "post",
            data:data
        })
    },
    removeAcquisitionList(id) {
        return request({
            url: url.ip3+"/acquisition/remove/"+id,
            method: "post"
        })
    },
    getMonitorFactorsList (id) {
        return request({
            url: url.ip3+"/monitorFactors/findByMonitorId/"+id,
            method: "post"
        })
    },

    addMonitorFactorsList(data) {
        return request({
            url: url.ip3+"/monitorFactors/save",
            method: "post",
            data:data
        })
    },
    editMonitorFactorsList(data) {
        return request({
            url: url.ip3+"/monitorFactors/edit",
            method: "post",
            data:data
        })
    },
    removeMonitorFactorsList(id) {
        return request({
            url: url.ip3+"/monitorFactors/remove/"+id,
            method: "post"
        })
    },
    getEquipmentList (id) {
        return request({
            url: url.ip3+"/monitor/equipment/findByMonitorId/"+id,
            method: "post"
        })
    },

    addEquipmentList(data) {
        return request({
            url: url.ip3+"/monitor/equipment/save",
            method: "post",
            data:data
        })
    },
    editEquipmentList(data) {
        return request({
            url: url.ip3+"/monitor/equipment/edit",
            method: "post",
            data:data
        })
    },
    removeEquipmentList(id) {
        return request({
            url: url.ip3+"/monitor/remove/"+id,
            method: "post"
        })
    },
})
